package _spring_test._CircularReference2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @Author: huangya
 * @Date: 2020/09/22
 * @Description:
 */
@Component
public class ClassBController {

    @Autowired
    ClassB222 classB222;

    public String test(){
        return classB222.bbb();
    }

    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("CircularReference2/application-circular-reference2.xml");
        ClassBController classBController = (ClassBController)ac.getBean("classBController");
        classBController.test();

//        ClassB222 classB222 = (ClassB222)ac.getBean("classB222");
//        System.out.println(classB222.bbb());
    }
}
